package com.yuou.common.utils;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;

import com.yuou.model.Bloger;

public class ShiroUtils {
	public static Subject getSubject() {
		return SecurityUtils.getSubject();
	}
	
	
	// admin
	public static Bloger getSysUser() {
		return (Bloger)getSubject().getPrincipal();
	}
	public static Integer getUserId() {
		return getSysUser().getId();
	}
	
	public static void logout() {
		getSubject().logout();
	}
}
